package com.java.basis.generic;

/**
 * 泛型接口
 * 语法，接口名<T>
 * 注意：在使用泛型接口的时候，不能使用泛型来创建常量
 * @author wangning
 * @create 2021-04-21 20:54
 */
public interface MyGenericInterface<T> {
	String name = "张三";

	T server(T t);
}

class MyGenericInterfaceImpl implements MyGenericInterface<String> {

	@Override
	public String server(String s) {
		System.out.println("s = " + s);
		return s;
	}
}

class MyGenericInterfaceImpl02<T> implements MyGenericInterface<T> {

	@Override
	public T server(T t) {
		System.out.println("t = " + t);
		return t;
	}
}